<%@page import="study.top.common.DBHandler"%>
<%@page import="study.top.mydb.items.WishListShowItem"%>
<%@page import="java.util.ArrayList"%>
<%@page import="study.top.mydb.WishListProduct"%>
<%@page import="study.top.common.PatternChecker"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true"%>
<%@ page session="true"%>
<%@ include file="dbcon.jsp"%>
<%@ include file="topcategory.jsp"%>

<%
	db.connect();
	WishListProduct w = new WishListProduct();
	String[] seq = request.getParameterValues("chkbox");

	if (seq == null) {
		out.print("<script type='text/javascript'>alert('선택된 상품이 없습니다.');history.back();</script>");
		return;
	}
	for (int i = 0; i < seq.length; i++) {
		int seq1 = Integer.parseInt(seq[i]);
		boolean result = w.WishListProductDelete(mem_seq, seq1);
		if (!result) {
			out.print("<script type='text/javascript'>alert('삭제에 실패했습니다.');history.back();</script>");
			return;
		}
	}
	DBHandler.getInstance().disconnect();
	response.sendRedirect("uWishList.jsp");
%>